<?php
include '../../DB/dbConnection.php';

$final=array();
	
$stmt = $conn->prepare("SELECT * FROM school WHERE request=1");
$success = $stmt->execute();
$stmt->bind_result($id, $school, $name, $email, $phone, $state, $city, $password, $request, $activate);

while ($stmt->fetch()) {
		$tmp=array();
		$tmp['id']=$id;
		$tmp['school']=$school;
		$tmp['name']=$name;
		$tmp['email']=$email;
		$tmp['phone']=$phone;
		$tmp['state']=$state;
		$tmp['city']=$city;
		$tmp['password']=$password;
		$tmp['request']=$request;
		$tmp['activate']=$activate;
		
		array_push($final,$tmp);
}

	$result=array();

	if($success)
	{
		$result['error']='false';
		$result['list']=$final;
	}
	else
		$result['error']='true';
		
	echo json_encode($result);
?>
